<template>
	<div class="securitySettings">
		<!--选项包围-->
		<div class="securitySettings_container">
            <van-cell title="绑定其他微信账号" is-link @click="$router.push('/public/bindotherwechat')" />
			<van-cell title="修改密码" @click="$router.push('/public/changePassword')" is-link size="large" />
			<van-cell title="注销" is-link size="large" @click="eventClickLoginOut" />
		</div>
	</div>
</template>

<script>
	import { Cell, CellGroup, Dialog } from 'vant';

	export default {
		name: "securitySettings",
		components: { [Cell.name]: Cell, [CellGroup.name]: CellGroup },
		data() {
			return {}
		},
		created() {
		},
		methods: {
			eventClickLoginOut: function () {
				Dialog.confirm({
					title: '提示', message: '确认注销'
				}).then(() => {
					let params = {
						token: this.$store.state.options.user.token
					};

					this.$util.postRequestInterface('/api/home/user/logout', params, (res) => {
						window.sessionStorage.clear();
						window.localStorage.clear();
						this.$router.push('/login');
					});
				}).catch(() => {
				});
			},
		}
	}
</script>

<style scoped lang = "scss">
</style>